﻿// <copyright file="string.cs" company="Todd Aspeotis">
//  Copyright © 2011 Todd Aspeotis 
// </copyright>

namespace LocalReportsEngine.ExtensionMethods
{
    using System;

    /// <summary>
    /// Provides extension methods for <see cref="string"/>.
    /// </summary>
    public static partial class ExtensionMethods
    {
        /// <summary>
        /// Compares two strings in a culture and case invariant manner.
        /// </summary>
        /// <param name="that">First string to compare. Can be <see langword="null"/>.</param>
        /// <param name="comparand">Second string to compare. Can be <see langword="null"/>.</param>
        /// <returns>
        /// <see langword="true"/> if the strings are equal, <see langword="false"/> otherwise.
        /// </returns>
        public static bool SafeEquals(this string that, string comparand)
        {
            return StringComparer.InvariantCultureIgnoreCase.Equals(that, comparand);
        }
    }
}
